<!--
*Author：COCO
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mass/mass/Mass_ProcessIns.js此处编写
 -->
<template>
	<view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields"
		:editFormOptions="editFormOptions" :searchFormFields="searchFormFields" :searchFormOptions="searchFormOptions"
		:table="table" :extend="extend">
	</view-grid>
</template>
<script>
import extend from "@/extension/mass/Mass_ProcessIns.js";
import { ref, defineComponent } from "vue";
export default defineComponent({
	setup() {
		const table = ref({
			key: 'Mass_ProcessIns_ID',
			footer: "Foots",
			cnName: '过程检验单',
			name: 'Mass_ProcessIns',
			url: "/Mass_ProcessIns/",
			sortName: "Mass_ProcessIns_ID"
		});


		const editFormFields = ref({
			"Mass_ProcessIns_Name": "",
			"Mass_ProcessIns_Code": "",
			"Mass_ProcessIns_Type": "",
			"Mass_ProcessIns_ProID": "",
			"Mass_ProcessIns_ProName": "",
			"Mass_ProcessIns_ProCode": "",
			"Mass_ProcessIns_ProModel": "",
			"Mass_ProcessIns_ProcessCode": "",
			"Mass_ProcessIns_ProcessName": "",
			"Mass_ProcessIns_AgreeNum": "",
			"Mass_ProcessIns_DisAgreeNum": "",
			"SlightNum": "",
			"CheckDate": "",
			"FatelNum": "",
			"SevereNum": "",
			"CreateDate": "",
			"CheckResult": "",
			"Remark": ""
		});


		const editFormOptions = ref([
			[
				{ "title": "检验单名称", "required": true, "field": "Mass_ProcessIns_Name", "type": "text" },
				{ "title": "检验单编码", "field": "Mass_ProcessIns_Code", "type": "text" },
				{ "dataKey": "Mass_DetectionTemplate", "data": [], "title": "检验类型", "required": true, "field": "Mass_ProcessIns_Type", "type": "select" }
			],
			[
				{ "title": "产品编码", "required": true, "field": "Mass_ProcessIns_ProCode", "disabled": true, "type": "text" },
				{ "title": "产品名称", "required": true, "field": "Mass_ProcessIns_ProName", "disabled": true },
				{ "title": "规格型号", "required": true, "field": "Mass_ProcessIns_ProModel", "disabled": true },
			],
			[
				{ "title": "工序编码", "required": true, "field": "Mass_ProcessIns_ProcessCode", "disabled": true, "type": "text" },
				{ "title": "工序名称", "required": true, "field": "Mass_ProcessIns_ProcessName", "disabled": true }
			],
			[
				{ "title": "合格品数量", "required": true, "field": "Mass_ProcessIns_AgreeNum", "type": "number" },
				{ "title": "不合格数", "required": true, "field": "Mass_ProcessIns_DisAgreeNum", "type": "number" },
				{ "title": "检测日期", "required": true, "field": "CheckDate", "type": "date" }
			],
			[
				{ "title": "致命缺陷数量", "required": true, "field": "FatelNum", "type": "number" },
				{ "title": "严重缺陷数量", "required": true, "field": "SevereNum", "type": "number" },
				{ "title": "轻微缺陷数量", "required": true, "field": "SlightNum", "type": "number" }
			],
			[
				{ "dataKey": "QcResult", "data": [], "title": "检测结果", "required": true, "field": "CheckResult", "colSize": 4, "type": "select" },
				{ "title": "备注", "field": "Remark", "colSize": 8, "type": "textarea" }
			]
		]);


		const searchFormFields = ref({});


		const searchFormOptions = ref([]);


		const columns = ref([{ field: 'Mass_ProcessIns_ID', title: '过程检验单主键', type: 'int', width: 110, hidden: true, readonly: true, require: true, align: 'left' },
		{ field: 'Mass_ProcessIns_Name', title: '检验单名称', type: 'string', width: 120, align: 'left', sort: true },
		{ field: 'Mass_ProcessIns_Code', title: '检验单编码', type: 'string', width: 120, align: 'left', link: true },
		{ field: 'Mass_ProcessIns_Type', title: '检验类型', type: 'string', bind: { key: 'QcTypeList', data: [] }, width: 120, align: 'left' },
		{ field: 'Mass_ProcessIns_ProID', title: '产品', type: 'int', width: 110, align: 'left' },
		{ field: 'Mass_ProcessIns_ProName', title: '产品名称', type: 'string', width: 120, align: 'left' },
		{ field: 'Mass_ProcessIns_ProCode', title: '产品编码', type: 'string', width: 120, readonly: true, require: true, align: 'left' },
		{ field: 'Mass_ProcessIns_ProModel', title: '规格型号', type: 'string', width: 180, align: 'left' },
		{ field: 'Mass_ProcessIns_ProcessID', title: '工序', type: 'int', width: 110, align: 'left' },
		{ field: 'Mass_ProcessIns_ProcessCode', title: '工序编码', type: 'string', width: 120, align: 'left' },
		{ field: 'Mass_ProcessIns_ProcessName', title: '工序名称', type: 'string', width: 120, align: 'left' },
		{ field: 'Mass_ProcessIns_AgreeNum', title: '合格品数量', type: 'int', width: 110, align: 'left' },
		{ field: 'Mass_ProcessIns_DisAgreeNum', title: '不合格数', type: 'int', width: 110, align: 'left' },
		{ field: 'FatelNum', title: '致命缺陷数量', type: 'int', width: 110, align: 'left' },
		{ field: 'SevereNum', title: '严重缺陷数量', type: 'int', width: 110, align: 'left' },
		{ field: 'SlightNum', title: '轻微缺陷数量', type: 'int', width: 110, align: 'left' },
		{ field: 'CheckDate', title: '检测日期', type: 'datetime', width: 110, align: 'left', sort: true },
		{ field: 'CheckResult', title: '检测结果', type: 'string', bind: { key: 'CheckResult', data: [] }, width: 120, align: 'left' },
		{ field: 'Remark', title: '备注', type: 'string', width: 220, align: 'left' },
		{ field: 'CreateID', title: '创建人编号', type: 'int', width: 80, hidden: true, align: 'left' },
		{ field: 'Creator', title: '创建时间', type: 'string', width: 130, align: 'left' },
		{ field: 'CreateDate', title: '修改人编号', type: 'datetime', width: 110, align: 'left', sort: true },
		{ field: 'ModifyID', title: '修改人编号', type: 'int', width: 80, hidden: true, align: 'left' },
		{ field: 'Modifier', title: '修改人', type: 'string', width: 130, align: 'left' },
		{ field: 'ModifyDate', title: '修改时间', type: 'datetime', width: 110, align: 'left', sort: true }]);


		const detail = ref({
			cnName: "过程检验单-检验单",
			table: "Mass_ProcessIns_DetItems",
			columns: [
				{ field: 'Mass_ProcessIns_CheckId', title: '过程检验单检测项主键', type: 'int', width: 110, hidden: true, require: true, align: 'left' },
				{ field: 'Mass_ProcessInsId', title: '过程检验单主键', type: 'int', width: 110, hidden: true, require: true, align: 'left' },
				{ field: 'Mass_ProcessIns_Template_Item_ItemId', title: '检测项主键', type: 'int', width: 110, hidden: true, require: true, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_Name', title: '检测项名称', type: 'string', width: 120, align: 'left', sort: true },
				{ field: 'Mass_ProcessIns_DetItems_Code', title: '检测项编码', type: 'string', width: 120, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_Type', title: '检测项类型', type: 'string', bind: { key: 'QCDefectType', data: [] }, width: 180, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_Tool', title: '检测工具', type: 'string', width: 180, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_Require', title: '检测要求', type: 'string', width: 180, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_StandardValue', title: '标准值', type: 'decimal', width: 110, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_ErrorUp', title: '误差上限', type: 'decimal', width: 110, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_ErrorDown', title: '误差下限', type: 'decimal', width: 110, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_FatelNum', title: '致命缺陷数量', type: 'int', width: 110, edit: { type: 'number' }, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_SevereNum', title: '严重缺陷数量', type: 'int', width: 110, edit: { type: 'number' }, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_SlightNum', title: '轻微缺陷数量', type: 'int', width: 110, edit: { type: 'number' }, align: 'left' },
				{ field: 'Mass_ProcessIns_DetItems_Remark', title: '备注', type: 'string', width: 220, edit: { type: 'text' }, align: 'left' },
			],
			sortName: "Mass_OutInspection_CheckItemId",
			key: "Mass_OutInspection_CheckItemId"
		});


		return {
			table,
			extend,
			editFormFields,
			editFormOptions,
			searchFormFields,
			searchFormOptions,
			columns,
			detail,
		};
	},
});
</script>
